var express = require('express')
var router = express.Router()

/* GET users listing. */
router.get('/list', function (req, res, next) {
  //   res.set('Content-Type', 'application/json')
  console.log(req.cookies, '---- 获取cookie-parser 解析的cookie ---')

  res.json({
    code: 200,
    data: [
      {
        id: 1,
        title: '文章标题1',
        content: '文章内容1',
      },
      {
        id: 2,
        title: '文章标题2',
        content: '文章内容2',
      },
    ],
  })
})

router.get('/detail', function (req, res, next) {
  res.json({
    code: 200,
    data: [
      {
        id: 3,
        title: '文章标题1',
        content: '文章内容1',
      },
    ],
  })
})

module.exports = router
